home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Sample Controls / BDiamond / CBaseEventClient.h < prev    next >
Encoding:
Text File  |  1996-12-20  |  2.4 KB  |  75 lines  |  [TEXT/CWIE]

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. //    CBaseEventClient.h
  4. //
  5. //
  6.  
  7. #ifndef __CBaseEventClient__
  8. #define __CBaseEventClient__
  9.  
  10. #include "BDInterfaces.h"
  11.  
  12. ///////////////////////////////////////////////////////////////////////////////
  13. //
  14. // Constants
  15. //
  16.  
  17. const char MAX_NUM_SOURCE_CONTROLS        = 50;    // an arbitrary limit. We could make this dynamic. 
  18. const char SOURCEOBJECT_STR[]             = "sourceobject";
  19.  
  20. ///////////////////////////////////////////////////////////////////////////////
  21. //
  22. // class declaration
  23. //
  24.  
  25. class CBaseEventClient : 
  26.     public CBaseCOM,
  27.     public IPersistPropertyBag
  28. {
  29. public:
  30.     
  31.     // Initialization
  32.     CBaseEventClient(void);
  33.     ~CBaseEventClient();
  34.  
  35.     //  *** IUnknown methods ***
  36.     STDMETHOD (QueryInterface)(REFIID inRefID, void** outObj);
  37.     STDMETHOD_ (Uint32, AddRef)(void) { return CBaseCOM::AddRef(); }
  38.     STDMETHOD_ (Uint32, Release)(void) { return CBaseCOM::Release(); }
  39.  
  40.     //  *** IPersist methods ***
  41.     STDMETHOD (GetClassID)(CLSID* classID)
  42.         { return ResultFromScode(E_NOTIMPL); }
  43.  
  44.     //  *** IPersistPropertyBag methods ***
  45.     STDMETHOD (InitNew)(void) 
  46.         { return ResultFromScode(S_OK); }
  47.     STDMETHOD (Load)(IPropertyBag* propertyBag, IErrorLog* errorLog);
  48.     STDMETHOD (Save)(IPropertyBag* propertyBag, BOOL clearDirty, BOOL saveAllProperties)
  49.         { return ResultFromScode(E_NOTIMPL); }
  50.  
  51. // Methods involving connecting to other controls (by name).
  52. protected:
  53.     virtual Boolean        AddIncomingInterface(IID incomingInterfaceID);
  54.     virtual void         SetUpConnections(IContainerSite * containerSite, IContainer * container);
  55.     virtual Boolean     IsSource(IUnknown * unk);
  56.     virtual Boolean     IsSource(char * sourceName);
  57.     virtual void         SetSourceName(char * theName);
  58.     virtual void         AddDesiredSourceName(char * theName);
  59.     virtual Boolean         AddSource(char * sourceName);
  60.     
  61. protected:
  62.     IID                mIncomingInterfaceID;
  63.     char *            mSourceName;
  64.     char *            mDesiredSources[MAX_NUM_SOURCE_CONTROLS]; // the ids of the specific controls that we want to get messages from
  65.     char *            mFoundSources[MAX_NUM_SOURCE_CONTROLS]; // the ids of the specific controls that we've connected to
  66.     long            mNumDesiredSources;
  67.     long            mNumFoundSources;
  68.     DWORD            m_Cookie;// NOTE: if we ever actually use this for something, we need a 
  69.                             // list of them, since we allow connections to more than
  70.                             // one specific sources.
  71.     Boolean            mConnectingComplete;
  72. };
  73.  
  74. #endif // __CBaseEventClient__
  75.